package login

import (
	"ginjt/JsonResult"
	"github.com/gin-gonic/gin"
	"net/http"
)

func MustLogin(c *gin.Context)   {

	token := c.DefaultQuery("token","")
	if token == "" {
		c.JSON(http.StatusForbidden,JsonResult.NewR().PutCode(444).PutMsg("未登陆，禁止操作").GetH())
		c.Abort()
	}else {
		c.Next()
	}

}